#include "LogicClientLogin.h"
#include "LogicClientManager.h"
#include <iostream>

using namespace std;

LogicClientLoginManager * LogicClientLoginManager::plogin = NULL;

LogicClientLoginManager * LogicClientLoginManager::GetInstance()
{
	if (NULL == plogin)
	{
		plogin = new LogicClientLoginManager;
	}

	return plogin;
}

int LogicClientLoginManager::Process(Base::LoginResp * resp)
{
    cout<<"recv login resp"<<endl;

    //打印输出的东西
    cout<<resp->name()<<endl;
    cout<<resp->hit()<<endl;

    //击中砖块
    HitBrick();

    //死亡
    Dead();

	return 0;
}

int LogicClientLoginManager::HitBrick()
{
	Base::HitBrickReq *req = new Base::HitBrickReq;

	req->set_id(44442);

	//准备发送协议
	LogicClientManager::GetInstance()->SendMessage(req);

	return 0;
}

int LogicClientLoginManager::Dead()
{
	Base::BallDeadReq * req = new Base::BallDeadReq;

	LogicClientManager::GetInstance()->SendMessage(req);

	return 0;
}
